#include <iostream>
#include <cstring>
using namespace std;

class Student
{
    private:
        char name[10];
        char id[10];
        float math;
        float chinese;
        float english;

    public:
        Student(const char* n, const char* i, float ch, float ma, float eng)
        {
            strcpy(name, n);
            strcpy(id, i);
            chinese = ch;
            math = ma;
            english = eng;
        }
        bool operator==(const Student& other) const
        {
            float score1 = (chinese + math + english) / 3;
            float score2 = (other.chinese + other.math + other.english) / 3;
            return score1 == score2;
        }

        bool operator>(const Student& other) const
        {
            float score1 = (chinese + math + english) / 3;
            float score2 = (other.chinese + other.math + other.english) / 3;
            return score1 > score2;
        }
        friend bool operator==(const Student& a1, const Student& a2);
        friend bool operator>(const Student& a1, const Student& a2);
};

bool operator==(const Student& a1, const Student& a2) {
    float score1 = (a1.chinese + a1.math + a1.english) / 3;
    float score2 = (a2.chinese + a2.math + a2.english) / 3;
    return score1 == score2;
}

bool operator>(const Student& a1, const Student& a2) {
    float score1 = (a1.chinese + a1.math + a1.english) / 3;
    float score2 = (a2.chinese + a2.math + a2.english) / 3;
    return score1 > score2;
}

int main()
{
    Student A("ZhangSan", "23013131", 100, 80, 90);
    Student B("LiSi", "23013121", 90, 95, 80);
    bool a = A == B;
    bool b = A > B;
    if (a) cout << "A=B" << endl;
    else cout << "A!=B" << endl;
    if (b) cout << "A>B" << endl;
    else cout << "A<=B" << endl;

    return 0;
}
